package com.javaee.term.service.iml;

import com.javaee.term.data.ConverAnaly;
import com.javaee.term.data.TurnOver;
import com.javaee.term.model.Product;
import com.javaee.term.service.ProductService;
import com.javaee.term.service.base.BaseServiceIml;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author 陈伯瑞
 * date 2019/12/16 0016 21:12
 * version 1.0
 **/
@Service
public class ProductServiceIml  extends BaseServiceIml implements ProductService {

    @Override
    public Product findOne(Object id) {
        return productMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Product> findAll() {
        return productMapper.selectAll();
    }

    @Override
    public void delete(Object id) {
      productMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Product product) {
        return productMapper.insert(product);
    }

    @Override
    public int update(Product product) {
        return productMapper.updateByPrimaryKey(product);
    }

    @Override
    public List<TurnOver> getAllProductTurnOver() {
        return productMapper.getAllProductTurnOver();
    }
}
